# remap prefix frm 'C-b' to 'C-a'
#unbind C-b
#set-option -g prefix C-a
#bind-key C-a send-prefix
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %

# reload config file
bind r source-file ~/.tmux.conf
#source-file ~/.tmux/mylayout
#set -g mouse-select-pane on
#set -g mouse-select-window on
#set -g mouse-resize-pane on
set -g mouse on

#switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

## Use vim keybindings in copy mode
set-option -g mouse on
setw -g mode-keys vi
#set-option -s set-clipboard off
#bind P paste-buffer
#bind-key -T copy-mode-vi v send-keys -X begin-selection
#bind-key -T copy-mode-vi y send-keys -X rectangle-toggle
#unbind -T copy-mode-vi Enter
#bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
#bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i'

bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i'
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i' '\;' send -X clear-selection

## color
set -g default-terminal "screen-256color"
set-option -sg escape-time 10
set-option -g focus-events on
set-option -ga terminal-overrides ',alacritty:RGB'
